<?php

/**
 * @author Nguyen Xuan Hong
 * @copyright 2010
 */

	include('includes/dbconfig.php');
	require_once('includes/pageconfig.tbl.php');

	$pageconfig = new clsPageConfigTable();
	$pageconfig->loadDB();
	
	$pageconfig->addcounter();
	
	require_once('includes/user.login.php');
	$pClsUserLogin = new clsUserLogin();
	
	if($_REQUEST["loginmode"])
	{
		$loginmode = $_REQUEST["loginmode"];
		$url = $_SERVER['QUERY_STRING'];
		if($loginmode == "quicklogin")
		{
			$url = str_replace("&loginmode=quicklogin", "", $url);
			$url = str_replace("loginmode=quicklogin", "", $url);
			if($pClsUserLogin->avaibleSubmit())
			{
				if($pClsUserLogin->doLogin(spost('quickusername'), spost('quickpassword')))
				{		
				}		
				else
				{ 
					$fall_login_flag = true;
				}
			}
		}
		else if($loginmode == "quicklogout")
		{
			$pClsUserLogin->doLogOut();
			$url = str_replace("&loginmode=quicklogout", "", $url);
			$url = str_replace("loginmode=quicklogout", "", $url);
		}
		echo redirect2($url);
		exit();
	}
	
	require_once('includes/branch.tbl.php');
	$pClsBranch = new clsBranchTable();
	
	require_once('includes/class.tbl.php');
	$pClsClass = new clsClassTable();
	
	require_once('includes/album.tbl.php');
	$pClsAlbum = new clsAlbumTable();
	
	require_once('includes/picture.tbl.php');
	$pClsPicture = new clsPictureTable();
	
	require_once('includes/video.tbl.php');
	$pClsVideo = new clsVideoTable();
	
	require_once('includes/about.tbl.php');
	$pClsAbout = new clsAboutTable();
	
	$page = $_REQUEST["page"];
	$branch_id = $_REQUEST["branch"];
	
	$REQUEST_URI;
	$HTTP_REFERER;
	
?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="shortcut icon" href="favicon.ico">
<link href="stylesheet/ngoinhatretho.css" type="text/css" rel="stylesheet">
<link href="stylesheet/ui-lightness/ui.all.css" type="text/css" rel="stylesheet">

<script language="javascript" src="javascript/jquery/jquery-1.4.3.min.js"></script>
<script language="javascript" src="javascript/jqueryUI/jquery.ui.core.js"></script>
<script language="javascript" src="javascript/jqueryUI/jquery.ui.widget.js"></script> 
<script language="javascript" src="javascript/jqueryUI/jquery.ui.accordion.js"></script>
<script src="javascript/transitionshow.js" type="text/javascript"></script>


<script language="javascript" type="text/javascript">
	function showimagesandtext(src, width, height, text)
	{
		document.getElementById('imageshows').src=src;   
		document.getElementById('imageshows').width=width*6.5;   
		document.getElementById('imageshows').height=height*6.5;   
		document.getElementById('textimageshows').value=text;   
	}
</script>


<title><?php echo($pageconfig->value('title'));?></title>
</head>
<body>
<div id="page-wrapper" class="w1200">
	<div id="page-header" class="w1200">
    	<? include('header.php'); ?>
    </div>
	<div class="w1200">
    	<? include('menu.php'); ?>
    </div>
	<div class="w1200">
    	<? include('hotinfo.php'); ?>
    </div>
	<div id="page-main">
    	<table cellpadding="0" cellspacing="0" border="0" bgcolor="#F0F0F0">
			<tr><td class="h10"></td><td class="h10"></td><td class="h10"></td></tr>
    		<tr>
    			<td valign="top" height="100%" class="w220">
    				<? include('left.php'); ?>
				</td>
    			<td valign="top" height="100%" class="w800">
					<div class="w800" align="center">
						<div class="w780">
	    					<? include('main.php'); ?>
						</div>
					</div>
				</td>
				<td valign="top" height="100%" class="w280">
    				<? include('right.php'); ?>
				</td>
			</tr>
		</table>
		<table cellpadding="0" cellspacing="0" border="0" bgcolor="#F0F0F0">
    		<tr>
				<td class="w1200">
					<? include('footer.php'); ?>
				</td>
			</tr>
		</table>
    </div>
</div>
</body>
</html>